<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserScore extends Model
{
    protected $casts = [
        'year_id' => 'integer',
        'user_id' => 'integer',
        'to_user_id' => 'integer',
        'value' => 'integer'
    ];

    protected $fillable = [
        'year_id', 'user_id' ,'to_user_id' ,'value'
    ];

    protected $hidden = [
        'created_at', 'updated_at'
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function to_user()
    {
        return $this->belongsTo(User::class, 'to_user_id', 'id');
    }
}
